import Cookies from 'js-cookie'
const state = {
  lang: Cookies.get('lang') || 'zh'
}

const mutations = {
  SWITCHLANG (state, lang) {
    state.lang = lang
    Cookies.set('lang', lang)
  }
}

const actions = {
  setSwitchLang ({ commit }, lang) {
    commit('SWITCHLANG', lang)
  }
}
export default {
  namespaced: true,
  state,
  mutations,
  actions
}

